<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$model_name=$channel['sub_name'];
$menu_name=$channel['en_name'];
$sub_meun_name='add';
$page_name="添加".$model_name;
//error_reporting(0); //抑制所有错误信息
?>
<?php require_once 'public/header.php';?>
<?php require_once 'public/sidebar.php';?>

<div id="content">
    <div id="content-header">
      <div id="breadcrumb">
          <a href="<?php echo site_url($this->config->item('system_manage_path')."welcome");?>" title="系统首页" class="tip-bottom"><i class="icon-home"></i> 系统首页</a> 
          <a href="<?php echo site_url($this->config->item('system_manage_path').$menu_name);?>" title="<?php echo $model_name;?>列表" class="tip-bottom"><?php echo $model_name;?>列表</a> 
          <a class="current"><?php echo $page_name;?></a> 
      </div>
      <h1><?php echo $page_name;?></h1>
    </div>
    
    <div class="container-fluid">
      <hr>
      <div class="row-fluid">        
        <div class="widget-box">
          <div class="widget-content" style="padding-bottom:0px;">
            <form class="form-horizontal" method="post" action="<?php echo site_url($this->config->item('system_manage_path').$menu_name."/save/add");?>" name="basic_validate" id="basic_validate" novalidate>
              <div class="control-group">
                <label class="control-label"><?php echo $model_name;?>标题：</label>
                <div class="controls">
                  <input type="text" name="title" id="title" value="" class="span6">
                </div>
              </div>
              <div class="control-group">
                <label class="control-label">所属类别：</label>
                <div class="controls">
                <select name="cat_id" style="width:220px;">
                    <?php foreach ($catlist as $value){ ?>
                    <option value="<?php echo $value['id'] ?>">
                    <?php
                    if ($value['depth']=='2'){
                      echo "├  "; 
                    }
                    if ($value['depth']>2){
                        for ($i = 2; $i < $value['depth']; $i++) {
                            echo "│ "; 
                        }
                        echo "├  ";
                    }
                    ?>
                    <?php echo $value['name'] ?></option>
                    <?php }?>
                </select>
              	</div>
              </div>
              <div class="control-group">
                  <label class="control-label">缩略图：</label>
                  <div class="controls">
                    <input type="file" name="file" id="file" value="" />
                    <input type="hidden" name="pic" id="pic" value="" />
                  </div>
              </div>
              <div class="control-group">
                <label class="control-label"><?php echo $model_name;?>关键词：</label>
                <div class="controls">
                  <input type="text" name="keywords" id="keywords" value="" class="span6">
                </div>
              </div>
              <div class="control-group">
                <label class="control-label"><?php echo $model_name;?>描述：</label>
                <div class="controls">
                  <textarea id="desc" name="description" class="span7" rows="5"></textarea>
                </div>
              </div>
              <div class="control-group">
                <label class="control-label"><?php echo $model_name;?>内容：</label>
                <div class="controls">
                  <textarea id="content" name="content" rows="10" class="ckeditor"></textarea>
                </div>
              </div>
              
              <div class="control-group">
                <label class="control-label"><?php echo $model_name;?>排序：</label>
                <div class="controls">
                  <input type="text" name="sort" id="sort" value="<?php echo $show['sort']; ?>" class="span1"> 数字越大，排序越前
                </div>
              </div>
              <div class="form-actions">
                <input type="submit" value="确定" class="btn btn-success">
                <input type="button" value="取消" class="btn btn-danger" onClick="javascript: location.href='<?php echo $comeurl?>';"  />       
                <input type="hidden" name="lcomeurl" value="<?php echo $comeurl?>" />
                <input type="hidden" name="status" value="1" />
              </div>
            </form>
          </div>
          
        </div>
      </div>
    </div>
</div>

<?php require_once 'public/footer.php';?>